<template>
  <div class="login_box">
    <!--User-Login-->
    <h1>User Login</h1>
    <div class="avtar">
      <img src="../../../assets/avtar.png" />
    </div>
    <div class="login-form">
      <!-- <a>New user?<a href="#">Register here!</a></p> -->
      <el-form @submit.prevent>
        <div class="form-text">
          <el-input
            class="text"
            v-model="formData.name"
            placeholder="请输入.."
          />
          <el-input
            type="password"
            v-model="formData.pwd"
            placeholder="请输入.."
          />
        </div>
        <input type="submit" value="GO" @click="submitHander" />
      </el-form>
    </div>
  </div>
</template>
<script>
import { ref } from "vue";
export default {
  setup(props, context) {
    const { emit } = context; //结构出 emit 向外暴露接口
    let formData = ref({
      name: "",
      pwd: "",
    });
    //  向外暴露事件 submitha
    function submitHander() {
      emit("submitha", formData);
    }
    return { submitHander, formData };
  },
};
</script>
<style lang="less" scoped>
/* reset */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
dl,
dt,
dd,
ol,
nav ul,
nav li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
ol,
ul {
  list-style: none;
  margin: 0px;
  padding: 0px;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
/* start editing from here */
a {
  text-decoration: none;
}
.txt-rt {
  text-align: right;
} /* text align right */
.txt-lt {
  text-align: left;
} /* text align left */
.txt-center {
  text-align: center;
} /* text align center */
.float-rt {
  float: right;
} /* float right */
.float-lt {
  float: left;
} /* float left */
.clear {
  clear: both;
} /* clear float */
.pos-relative {
  position: relative;
} /* Position Relative */
.pos-absolute {
  position: absolute;
} /* Position Absolute */
.vertical-base {
  vertical-align: baseline;
} /* vertical align baseline */
.vertical-top {
  vertical-align: top;
} /* vertical align top */
nav.vertical ul li {
  display: block;
} /* vertical menu */
nav.horizontal ul li {
  display: inline-block;
} /* horizontal menu */
img {
  max-width: 100%;
}
/*end reset*/
body,
.login_box {
  font-family: Verdana;
  background: url("../../../assets/bg.jpg") no-repeat;
  background-size: 100% 135%;
}
.login_box {
  height: 100%;
}
.wrap {
  margin: 0 auto;
  width: 80%;
}
body a,
form li,
input[type="submit"],
input[type="text"],
.sixth-login input[type="submit"],
.third-login input[type="submit"] {
  transition: 0.1s all;
  -webkit-transition: 0.1s all;
  -moz-transition: 0.1s all;
  -o-transition: 0.1s all;
}
h1 {
  text-align: center;
  color: #ffffff;
  font-size: 3em;
  font-weight: 100;
  padding-top: 2em;
}
.avtar {
  width: 177px;
  height: 220px;
  margin: 2% auto 0 auto;
  padding-bottom: 1em;
  background-size: 100%;
}
.login-form {
  width: 33%;
  // height: 100%;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
form {
  padding-top: 1em;
  background: #dee1e8;
  border-radius: 0.4em;
}
form li {
  list-style: none;
  margin-bottom: 25px;
  width: 100%;
  background: #b73338;
  border-radius: 0.3em;
  -webkit-border-radius: 0.3em;
  -o-border-radius: 0.3em;
  -moz-border-radius: 0.3em;
}
/deep/ input {
  // width: 40%;
  // margin: 0.5rem;
  padding: 1.5em 1em 1.5em 1em;
  color: #3d3e6a;
  font-size: 14px;
  outline: none;
  background: #f5f6f7;
  border: none;
  font-weight: 100;
  margin-bottom: 1em;
  border: 1px solid#A8AEC5;
  border-radius: 0.4em;
  -webkit-border-radius: 0.4em;
  -o-border-radius: 0.4em;
  -moz-border-radius: 0.4em;
}
input[type="password"] {
  width: 40%;
  padding: 1em 1em 1em 1em;
  color: #3d3e6a;
  font-size: 14px;
  outline: none;
  background: #f5f6f7;
  border: none;
  margin-bottom: 1em;
  border: 1px solid#A8AEC5;
  border-radius: 0.4em;
  -webkit-border-radius: 0.4em;
  -o-border-radius: 0.4em;
  -moz-border-radius: 0.4em;
}
input[type="submit"] {
  background: #ff6600;
  padding: 0.8em 0.6em 0.8em 0.6em;
  outline: none;
  border: none;
  font-size: 1em;
  cursor: pointer;
  width: 8%;
  color: #fff;
  text-transform: uppercase;
  font-weight: bold;
  border-top-right-radius: 0.4em;
  -webkit-border-top-right-radius: 0.4em;
  -o-border-top-right-radius: 0.4em;
  -moz-border-top-right-radius: 0.4em;
  border-bottom-right-radius: 0.4em;
  -webkit-border-bottom-right-radius: 0.4em;
  -o-border-bottom-right-radius: 0.4em;
  -moz-border-bottom-right-radius: 0.4em;
  position: absolute;
  top: 1rem;
  right: -8%;
}
input[type="submit"]:hover {
  background: #1b2e68;
  color: #fff;
}
.login-form p {
  padding-bottom: 2em;
  color: #fff;
  font-weight: 100;
  font-size: 1.2em;
}
.login-form p a {
  text-decoration: underline;
  font-weight: 600;
  margin-left: 7px;
  color: #fff;
}
.login-form p a:hover {
  color: #1b2e68;
}
.copy-right {
  text-align: center;
  padding-top: 10em;
  color: #fff;
}
.copy-right p a {
  color: #fff;
}
.copy-right p a:hover {
  color: #ff6600;
}
/*--start-responsive-design--*/
@media (max-width: 1440px) {
}
@media (max-width: 1366px) {
  input[type="submit"] {
    width: 10%;
    right: -10%;
  }
  .copy-right {
    padding-top: 5em;
  }
}
@media (max-width: 1024px) {
  .login-form {
    width: 48%;
  }
  h1 {
    padding-top: 1em;
  }
}
@media (max-width: 768px) {
  .login-form {
    width: 60%;
  }
  body {
    font-family: Verdana;
    background-size: 100% 160%;
  }
  .avtar {
    margin: 8% auto 0 auto;
  }
  h1 {
    padding-top: 3em;
  }
}
@media (max-width: 640px) {
  .login-form {
    width: 70%;
  }
  .avtar {
    margin: 8% auto 0 auto;
  }
}
@media (max-width: 480px) {
  .login-form {
    width: 84%;
    margin: 2% 0% 0% 4%;
    text-align: center;
  }
}
@media (max-width: 320px) {
  .avtar img {
    width: 60%;
  }
  .avtar {
    text-align: center;
    width: 160px;
    height: 105px;
    margin: 10% auto 0 auto;
    padding-bottom: 0;
    background-size: 0;
  }
  input[type="text"] {
    width: 38%;
    padding: 1em 1em 1em 1em;
    font-size: 10px;
  }
  input[type="password"] {
    width: 38%;
    font-size: 10px;
  }
  input[type="submit"] {
    width: 12%;
    right: -12%;
    font-size: 10px;
    top: 64%;
    padding: 0.9em 0.6em 0.9em 0.6em;
  }
  .copy-right {
    padding-top: 5em;
  }
  h1 {
    padding-top: 1em;
    font-size: 2em;
  }
  .login-form p {
    margin-left: 1em;
  }
}

.form-text {
  display: flex;
}
</style>
